﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true" CodeFile="D_Bonus.aspx.cs" Inherits="Web_D_Bonus" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" DataSourceID="SqlDataSource1" KeyFieldName="D_ID" 
        CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
        Width="100%" onrowupdating="ASPxGridView1_RowUpdating">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0">
                <EditButton Visible="True">
                </EditButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>

                   </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="0">
                <NewButton Visible="True">
                </NewButton>
                   </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="0">
                <DeleteButton Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn FieldName="D_ID" ReadOnly="True" VisibleIndex="1" 
                Caption="Direct Bonus ID">
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Enter ID" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesTextEdit>
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="D_Rank"  VisibleIndex="3" 
                Caption="Bonus Rank">
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Enter Bonus Rank" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="D_Rate" VisibleIndex="5" 
                Caption="Bonus Rate">
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Enter  Bonus Rate" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        DeleteCommand="DELETE FROM [Tbl_DBonus] WHERE [D_ID] = @D_ID AND [D_Rank] = @D_Rank" 
        InsertCommand="INSERT INTO [Tbl_DBonus] ([D_Rank], [D_Rate]) VALUES (@D_Rank, @D_Rate)" 
        SelectCommand="SELECT [D_ID], [D_Rank], [D_Rate] FROM [Tbl_DBonus]" 
        
        UpdateCommand="UPDATE [Tbl_DBonus] SET [D_Rate] = @D_Rate WHERE [D_ID] = @D_ID AND [D_Rank] = @D_Rank">
        <DeleteParameters>
            <asp:Parameter Name="D_ID" Type="Int32" />
            <asp:Parameter Name="D_Rank" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="D_Rank" Type="String" />
            <asp:Parameter Name="D_Rate" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="D_Rate" Type="String" />
            <asp:Parameter Name="D_ID" Type="Int32" />
            <asp:Parameter Name="D_Rank" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

